from scrapy_main.opera.scrapy_process import ScrapyProcess


class BaseScraper:
    def __init__(self, json_file_path=None, params=None):
        raise NotImplementedError

    # 通过json文件初始化
    def init_by_json(self, file_path):
        raise NotImplementedError

    # 通过参数对象初始化
    def init_by_params(self, params):
        raise NotImplementedError

    # 通过参数对象初始化
    def init_saver(self):
        raise NotImplementedError

    # 获取列表页
    def get_page_list(self, html):
        raise NotImplementedError

    # 获取详情页
    def get_page_detail(self, html):
        raise NotImplementedError

    # 获取页码
    def get_pagination(self, html):
        raise NotImplementedError

    # 获取详情页内容
    def get_detail_page_content(self, html):
        raise NotImplementedError

    # 爬取列表
    def scrape_page_list(self, url):
        raise NotImplementedError

    # 爬取详情页
    def scrape_page_detail(self, page, counter, search_key=None):
        raise NotImplementedError

    # 爬取整个页面 包括列表页和详情页
    def scrape_whole_page(self, search_key, counter):
        raise NotImplementedError

    # 开始爬取
    def start_scraper(self):
        raise NotImplementedError

    # 爬取详细的分页内容
    def scrapy_detail_page_content(self, url):
        raise NotImplementedError

    def simulate_whole_page(self):
        raise NotImplementedError

    def simulate_page_list(self):
        raise NotImplementedError

    def simulate_page_detail(self, page):
        raise NotImplementedError
